﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DDD.Core;

using FloatComparer = DDDTest.Helper.FloatComparer;

using Vector3 = DDD.Core.Vector3<float>;
using Vector4 = DDD.Core.Vector4<float>;

namespace DDDTest.Core {
    [TestClass]
    public class TestPhongMaterial {
        [TestMethod]
        public void Test_New1 () {
            var mat = new PhongMaterial ();
            var amb = new Vector3 (1, 1, 1);
            var dif = new Vector4 (1, 1, 1, 1);
            var spc = new Vector4 (1, 1, 1, 10);

            Assert.AreEqual (amb, mat.Ambient);
            Assert.AreEqual (dif, mat.Diffuse);
            Assert.AreEqual (spc, mat.Specular);
        }

        [TestMethod]
        public void Test_SetAmbient () {
            var mat = new PhongMaterial ();
            mat.SetAmbient (0.1f, 0.2f, 0.3f);

            var expected = new Vector3 (0.1f, 0.2f, 0.3f);

            Assert.AreEqual (expected, mat.Ambient);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// 順番はR,G,B,Aの順番で渡す｡
        /// </remarks>
        [TestMethod]
        public void Test_SetDiffuse () {
            var mat = new PhongMaterial ();
            mat.SetDiffuse (0.1f, 0.2f, 0.3f, 0.4f);  // (*1) 

            var expected = new Vector4 (0.1f, 0.2f, 0.3f, 0.4f);  // 

            Assert.AreEqual (expected, mat.Diffuse);
        }

        [TestMethod]
        public void Test_SetSpecular () {
            var mat = new PhongMaterial ();
            mat.SetSpecular (0.1f, 0.2f, 0.3f, 0.4f);

            var expected = new Vector4 (0.1f, 0.2f, 0.3f, 0.4f);

            Assert.AreEqual (expected, mat.Specular);
        }
    }
}
